<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    *{
        margin:0;
        padding:0
    }
    #box{
        width:280px;
        height:280px;
        border:1px solid #1a1a1a;
        text-align:center;
        line-height: 280px;
    }
    button{
            width:50px;
            height: 30px;
    }
    </style>
</head>
<body>
    <div id="box">

    </div>
    <button id="start">开始</button>
    <button id="stop">停止</button>
    <script>
    var box=document.getElementById("box");
    var start=document.getElementById("start");
    var stop=document.getElementById("stop");
    var index=0;
    var time=""
    var array=["迪奥","美宝莲","纪梵希","香奈儿","阿玛尼","MAC","YSL"];
    start.onclick=function(){
        time=  setInterval(() => {
            box.innerHTML=array[index];
            index++;
            if(index>array.length-1){
                index=0;
            }
           
        }, 100);
       
    }
    stop.onclick=function(){
        clearInterval(time);
    }
    </script>
</body>
</html>